/*
 *  * Copyright (c) 2016. For Intelligent Group.
 */

package com.intelligent.ispc.chart.service;

import com.intelligent.ispc.core.dto.ChartDto;
import com.intelligent.ispc.core.dto.GrrExportParamDto;
import com.intelligent.ispc.core.dto.GrrResultDto;
import com.intelligent.ispc.r.dto.ControlDataDto;
import com.intelligent.ispc.r.dto.NormalDistributionDto;
import com.intelligent.ispc.r.dto.ScatterDto;

import java.util.List;
import java.util.Map;

/**
 * Created by Peter on 2016/9/7.
 * Changed by Can.Guan on 2016/9/7
 */
public interface ChartExporter {
    /**
     * export ND chart to gif format
     * @param normalDistributionDto (x, y) coordinate for ND histogram
     * @param chartName charName for ND chart
     * @param path location for saving graph
     */
    void exportSpcNDChart2Gif(NormalDistributionDto normalDistributionDto, String chartName, String path);

    /**
     * export SPC scatter chart to gif format
     * @param scatterDto (x, y) coordinate for scatters in chart and sigma, including the mean line
     * @param charName charName for Scatter chart
     * @param path location for saving graph
     */
    void exportSpcScatter2Gif(ScatterDto scatterDto, String charName, String path);

    /**
     * export SPC Run Chart, XBar Chart, SD chart, R Chart, MR Chart to gif format
     * @param controlDataDto (x, y) coordinate for scatters in chart and sigma
     * @param chartDto char name for chart and additional lines
     * @param path location for saving graph
     */
    void exportSpcRunChart2Gif(ControlDataDto controlDataDto, ChartDto chartDto, String path);

    /**
     * export all charts in this method to gif format
     * @param controlDataDtoMap all charts information
     * @param chartDto chart name for charts
     * @param imgPath locations for saving graph
     */
    void exportSpcAllRunChart2Gif(Map<String, ControlDataDto> controlDataDtoMap, ChartDto chartDto, Map<String, String> imgPath);

    /**
     * export R&R Plot - By Appraisers, R&R Plot - By Parts to gif format
     * @param aplotValue (x, y) coordinate for scatters in chart
     * @param operator the Number of operators
     * @param part the Number of parts
     * @param path location for saving path
     */
    void exportGrrAPlotChart2Gif(double[][] aplotValue, int operator, int part, String path);

    /**
     * export Components of Variation to gif format
     * @param componentData (x, y) coordinate for bar chart
     * @param path location for saving path
     */
    void exportGrrComponentsChart2Gif(double[][] componentData, String path);

    /**
     * export R - Chart to gif format
     * @param value x coordinate for scatters in chart
     * @param chartType line name for popping up information
     * @param part the Number of parts
     * @param trial the Number of trials
     * @param path location for saving path
     */
    void exportGrrRPlotChart2Gif(double[] value, String chartType, int part, int trial, String path);

    /**
     * export Xbart - Chart to gif format
     * @param value x coordinate for scatters in chart
     * @param part the Number of parts
     * @param path location for saving path
     */
    void exportGrrXBarChart2Gif(double[] value, int part, String path);

    /**
     * export Part by Appraisers Plot to gif format
     * @param value x coordinate for scatters in chart
     * @param part the Number of parts
     * @param path location for saving path
     */
    void exportGrrRChart2Gif(double[] value, int part, String path);

    /**
     * export all charts in grr to gif format
     * @param grrResultDto information for charts
     * @param grrExportParamDto additional information for charts
     * @param imgPaths locations for saving path
     */
    void exportGrrChart(GrrResultDto grrResultDto, GrrExportParamDto grrExportParamDto, List<String> imgPaths);
}
